<?php
define('IN_ADMIN',True);
require_once('include/common.php');
require_once('include/function_crm.php');
if ( !$_USER->id ) {
	show_msg('你还没有登录，请先登录', 'login.php', 1000);
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><html>
<title>天生创想《客户及进销存》企业管理系统</title>
<link rel="stylesheet" type="text/css" href="template/default/crm/home.css" />
</head>
<body>

   <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" style="margin:0px;padding:0px; ">
<tr>
    <td align="center" valign="top" style="padding-top:70px;">
		<div class="crm-box">
			  <a href="admin.php?ac=bbs&fileurl=knowledge" title="BBS"><div class='menu-a' onMouseOver="this.style.top='133px'" onMouseOut="this.style.top='130px'"></div></a>
              <a href="admin.php?ac=company&fileurl=crm" title="客户"><div class='menu-b' onMouseOver="this.style.top='148px'" onMouseOut="this.style.top='145px'"></div></a>
              <a href="admin.php?ac=crm_business&fileurl=crm&menuid=236" title="代理商"><div class='menu-c' onMouseOver="this.style.top='153px'" onMouseOut="this.style.top='150px'"></div></a>
              <a href="admin.php?ac=crm_order&fileurl=crm" title="订单"><div class='menu-d' onMouseOver="this.style.top='158px'" onMouseOut="this.style.top='155px'"></div></a>
              <a href="admin.php?ac=crm_service&fileurl=crm&menuid=231" title="客户回访"><div class='menu-e' onMouseOver="this.style.top='153px'" onMouseOut="this.style.top='150px'"></div></a>
              <a href="admin.php?ac=crm_purchase&fileurl=crm" title="采购"><div class='menu-f' onMouseOver="this.style.top='148px'" onMouseOut="this.style.top='145px'"></div></a>
              <a href="admin.php?ac=crm_product&fileurl=crm" title="产品"><div class='menu-g' onMouseOver="this.style.top='133px'" onMouseOut="this.style.top='130px'"></div></a>
              
              </div>
   
	</td>
  <td width="240" valign="top">
      <div class="module listColor">
        <div class="head2">
          <div class="moduleHeader2">最新企业
		  </div>
        </div>
        <div class="module_body">
          <div class="module_div">
          	<ul>
			<?php
			global $db;
	        $query = $db->query("SELECT * FROM ".DB_TABLEPRE."crm_company where uid =".$_USER->id." or workuser=".$_USER->id." and unionid='".union_id."' ORDER BY id desc limit 0,6");
			while ($row = $db->fetch_array($query)) {
			?>
		<li><a href='admin.php?ac=company_views&fileurl=crm&id=<?=$row['id']?>' style='color:#FF0000;'><?=cut_str(GET_CRM_DB_FROM_VIEWS("_1_title",1,$row['id']),26)?></a></li>
			<?php
		   }
		   ?>
            
</ul>
          </div>
        </div>
      </div>
      
      <div class="module listColor">
        <div class="head2">
          <div class="moduleHeader2">等待回访企业</div>
        </div>
        <div class="module_body">
          <div class="module_div">
          	<ul>
				<?php
			
			global $db;
	        $query = $db->query("SELECT * FROM ".DB_TABLEPRE."crm_service where (workuser=".$_USER->id." or uid=".$_USER->id.") and type='0' and unionid='".union_id."' ORDER BY id desc limit 0,6");
			while ($row = $db->fetch_array($query)) {
			?>
		<li style='color:#FF0000;'><a href='admin.php?ac=crm_service_views&fileurl=crm&id=<?=$row['id']?>' style='color:#FF0000;'><?=cut_str(GET_CRM_DB_FROM_VIEWS("_1_title",1,$row['companyid']),26)?></a></li>
			<?php
		   }
		   ?>         	</ul>
			<div style="text-align:right;margin-right:20px;margin-top:5px;"><a href="admin.php?ac=crm_service&fileurl=crm&menuid=159">更多 >></a></div>
          </div>
        </div>
      </div>
	</td>
  </tr>
</table>

</body>
</html>